package com.minsu.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.minsu.entity.CleanRecord;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import java.util.List;
import java.util.Map;

@Mapper
public interface CleanRecordMapper extends BaseMapper<CleanRecord> {
    
    /**
     * 获取任务的清洗统计信息
     */
    @Select("SELECT clean_type, COUNT(*) as count FROM clean_records WHERE task_id = #{taskId} GROUP BY clean_type")
    List<Map<String, Object>> getCleanTypeStats(String taskId);
    
    /**
     * 获取任务的清洗记录
     */
    @Select("SELECT * FROM clean_records WHERE task_id = #{taskId} ORDER BY created_at DESC")
    List<CleanRecord> getTaskRecords(String taskId);
} 